#pragma once

#include "BasicType.h"
#include "Character.h"

namespace LightPlayer {

	class LightAbstractRenderer;
	class Parser;

	enum eSceneObjectType{
		eSceneObject = 0,
		eTimelineObject
	};

	class SceneObject {
		Character*		m_pCharacter;
	public:
		const char*		m_Name;
		uint16			m_Depth;
		uint16			m_ClipDepth;
		MATRIX			m_Transform;
		CXFORM			m_ColorTransfom;
		uint16			m_MorphRatio;
		bool			m_LockByActionScript;

		SceneObject();
		virtual ~SceneObject(){};
		virtual void		init();

				const char*				getName() const									{return m_Name;}
				Character*				getCharacter()									{return m_pCharacter;}
				const Character*		getCharacter()	const							{return m_pCharacter;}
		virtual void					SetParent(Parser* pParent)						{ /*Do nothing, no need to keep parent in SceneObject for now. only in timelineObj.*/; }
		virtual void					setCharacter(Character* character)				{m_pCharacter = character; }
		virtual void					update(float dt);
		virtual void					draw(LightAbstractRenderer* pRenderer);
		virtual eSceneObjectType		getType()										{return eSceneObject;}
		
		bool							isMask() const									{return m_ClipDepth != 0;}
		uint16							GetClipDepth() const							{return m_ClipDepth;}
		uint16							GetDepth() const								{return m_Depth;}
		virtual RECT					getBounds() const;
		virtual CXFORM					getResolvedCXFORM() const;
	};		

};